﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.WorkBill
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.WorkBill;

    public class WorkBillType_Map : EntityMapping<WorkBillType>
    {
        public WorkBillType_Map()
        {
            Property(x => x.TypeCode, map =>
            {
                map.Length(50);
            });

            Property(x => x.TypeName, map =>
            {
                map.Length(200);
            });

            Property(x => x.TypeRate, map =>
            {
            });

            Bag(x => x.WorkBills, map =>
            {
                map.Key(keyMapper => keyMapper.Column("TypeId"));
            }, act => act.OneToMany());
        }
    }
}
